{strip}

{literal}

<script>

function getAddForm(){
		
	$.ajax({
		type: "GET",
		url: "/statuses/add-catalogue",
		data: {
			
		},
		success: function(data){
			showPopup(data, 'Add new status catalogue', false);
		},
		error: function(xhr, statusText, errorThrown){
			showPopup(xhr.responseText, statusText, false);
		}    
	
	});
}

function getEditForm(statusesCataloguesId){
		
	$.ajax({
		type: "GET",
		url: "/statuses/edit-catalogue",
		data: {
			statusesCataloguesId: statusesCataloguesId
		},
		success: function(data){
			showPopup(data, 'Edit catalogue details', false);
		},
		error: function(xhr, statusText, errorThrown){
			showPopup(xhr.responseText, statusText, false);
		}    
	
	});
}

function deleteCatalogue(statusesCataloguesId){
	if (confirm('Are you sure you want to remove this catlogue?')){
		$.ajax({
			type: "GET",
			url: "/statuses/delete-catalogue",
			data: {
				statusesCataloguesId: statusesCataloguesId
			},
			success: function(data){
				//showPopup(data, 'Skinshop activation', false);
				window.location.reload();
			},
			error: function(xhr, statusText, errorThrown){
				showPopup(xhr.responseText, statusText, false);
			}
	
		});
		
	}
	return false;
}

</script>

{/literal}
<!-- content -->
<div id="content">
    <div id="content_left">
		<div>
		<h2>STATUSES CATALOGUES</h2>
		</div>
	
		<div>
			<a class="button_" href="#" onclick="getAddForm();">{$commonLocale->t('ADD NEW')}</a>
		</div>
		
		<table class="activeTable">
			<tr>
				<td>ID</td>
				<td>CATALOGUE</td>
				<td> </td>
				<td> </td>
			</tr>
		{foreach from=$catalogues item=c name=forU}
			<tr>
				<td>{$c->getId()}</td>
				<td>{$c->getCatalogue()}</td>
				<td><a href="#" onclick="getEditForm({$c->getId()});">EDIT</a></td>
				<td><a href="#" onclick="deleteCatalogue({$c->getId()});">DELETE</a></td>
			</tr>
		{/foreach}
		</table>
	</div>
	<div id="content_right">
		{include file='admin/menu.tpl'}
	</div>
</div>
<!-- end content  -->
{/strip}